﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class disp_shiti : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["sTittle"] = "查询/修改试题";
            //zxdurl = "shiti_result.aspx?zxdpkey=" + txtSelect.Text.Trim() + "&zxdpkechengid=" + txtid.Text.Trim() + "&zxdpname=" + txtname.Text.Trim();
            txtid.Text = Request.QueryString["zid"];
            //txtname.Text = Request.QueryString["zxdpname"];
            //txtSelect.Text = Request.QueryString["zxdpkey"];
            ddlType1.SelectedValue = Request.QueryString["zxdptype"];
            if (txtSelect.Text == "")
            {
                string noth = "SELECT * FROM [kecheng_question_taoti] WHERE ([que_lessonid] =" + txtid.Text.Trim() + ") order by que_type,id";
                SDSquestion.SelectCommand = noth;
            }
            else
            {
                string noth1 = "SELECT * FROM [kecheng_question_taoti] WHERE ([que_lessonid] =" + txtid.Text.Trim() + " AND " + ddlType1.SelectedValue + " Like '%" + txtSelect.Text + "%') order by que_type,id";
                SDSquestion.SelectCommand = noth1;
            }
        }
    }
    protected void btnSelect_Click(object sender, EventArgs e)
    {
        if (txtSelect.Text == "")
        {
            string noth = "SELECT * FROM [kecheng_question_taoti] WHERE ([que_lessonid] =" + txtid.Text.Trim() + ") order by que_type,id";
            SDSquestion.SelectCommand = noth;
        }
        else
        {
            string noth1 = "SELECT * FROM [kecheng_question_taoti] WHERE ([que_lessonid] =" + txtid.Text.Trim() + " AND " + ddlType1.SelectedValue + " Like '%" + txtSelect.Text + "%') order by que_type,id";
            SDSquestion.SelectCommand = noth1;
        }
    }



    
}
